<template>
  <div class="layoutBox">
    <div class="titleBox">优秀新电台</div>
    <ul class="newRcommendationBox">
      <router-link
        tag="li"
        :to="{ name: 'radiostationdetail', query: { id: item.id } }"
        class="itemBox"
        v-for="item in newRcommendationList.slice(0, 5)"
        :key="item.id"
      >
        <img :src="item.picUrl" class="itemImg" alt="" />
        <div>
          <p class="itemName">{{ item.name }}</p>
          <p class="itemRcmdtext">{{ item.rcmdtext }}</p>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
import { excellentRadioStation } from "@/api";
export default {
  data() {
    return {
      newRcommendationList: [],
    };
  },
  created() {
    this.getDate();
  },
  methods: {
    getDate() {
      excellentRadioStation({ type: this.$route.query.id }).then((res) => {
        this.newRcommendationList = res.djRadios;
        console.log(res.djRadios);
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.layoutBox {
  margin-top: 35px;
  .titleBox {
    height: 40px;
    border-bottom: 2px solid #c20c0c;
    font-size: 24px;
    color: #333;
  }
  .newRcommendationBox {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    .itemBox {
      padding: 20px 0;
      width: 150px;
      cursor: pointer;
      .itemImg {
        width: 150px;
        height: 150px;
      }
      .itemName {
        margin: 13px 0 6px;
        font-size: 14px;
        color: #333;
      }
      .itemRcmdtext {
        line-height: 20px;
        color: #999;
      }
    }
  }
}
</style>